import { Commit } from "vuex";

interface IBrandNav {
  bottomImage: string;
  brandLimit: number;
  goodsLimit: number;
  id: number;
  smallPic: string;
  sort: number;
  title: string;
  topImage: string;
  typeId: number;
}
interface IBrandData {
  backgroundImg: string;
  brandId: number;
  brandLabelOne: any;
  brandLogo: string;
  brandName: string;
  discount: number;
  endNumTime: number;
  endTime: string;
  fansNum: number;
  hotPush: any;
  jumpType: number;
  label: string;
  longProfit: string;
  maxQuanJia: number;
  profitSwitch: number;
  recentSale: number;
  selfProfit: string;
  startNumTime: number;
  startTime: string;
  todayNewGoodsNum: number;
  typeId: number;
}
interface IBrandList {
  brandId: number;
  brandLabelOne: { val: string };
  brandLabelTwo: { val: string };
  brandLogo: string;
  brandName: string;
  discount: number;
  hotPush: any;
  maxQuanJia: number;
  recentSale: number;
  sort: number;
}
interface IState {
  brandNav: Partial<IBrandNav>[];
  brandOneData: Partial<IBrandData>[];
  brandTwoData: Partial<IBrandData>[];
  brandList: Partial<IBrandList>[];
}
interface IBrand {
  namespaced: boolean;
  state: IState;
  actions: {
    getBrandNav: ({ commit }: { commit: Commit }) => void;
    getBrandOneData: ({ commit }: { commit: Commit }) => void;
    getBrandTwoData: ({ commit }: { commit: Commit }) => void;
    getBrandList: (
      { commit }: { commit: Commit },
      { typeId }: { typeId: number }
    ) => void;
  };
  mutations: {
    GET_BRAND_NAV: (
      state: IState,
      action: {
        type: string;
        payload: Partial<IBrandNav>[];
      }
    ) => void;
    GET_BRAND_ONE_DATA: (
      state: IState,
      action: {
        type: string;
        payload: Partial<IBrandData>[];
      }
    ) => void;
    GET_BRAND_TWO_DATA: (
      state: IState,
      action: {
        type: string;
        payload: Partial<IBrandData>[];
      }
    ) => void;
    GET_BRAND_LIST: (
      state: IState,
      action: { type: string; payload: Partial<IBrandList>[] }
    ) => void;
  };
}

export default IBrand;
